package com.ytf.test.ninth.interfaces;

interface Monster {
    void menace();
}
interface DangerousMonster extends Monster{
    void destroy();
}
interface Lethal{
    void kill();
}
class DragonZilla implements DangerousMonster{

    @Override
    public void menace() {
        System.out.println("DragonZilla.menace()");
    }

    @Override
    public void destroy() {
        System.out.println("DragonZilla.destroy()");
    }
}
interface Vampire extends DangerousMonster,Lethal{
    void drinkBlood();
}
class VeryBadVampire implements Vampire{

    @Override
    public void menace() {
        System.out.println("VeryBadVampire.menace()");
    }

    @Override
    public void destroy() {
        System.out.println("VeryBadVampire.destroy()");
    }

    @Override
    public void kill() {
        System.out.println("VeryBadVampire.kill()");
    }

    @Override
    public void drinkBlood() {
        System.out.println("VeryBadVampire.drinkBlood()");
    }
}
/**
 * @author: YTF
 * @date: 2025/1/26 10:56
 * @version: 1.0
 * @description:
 */
public class HorrorShow {
    static void mons(Monster monster){
        monster.menace();
    }
    static void dangerousM(DangerousMonster dangerousMonster){
        dangerousMonster.menace();
        dangerousMonster.destroy();
    }
    static void let(Lethal lethal){
        lethal.kill();
    }

    public static void main(String[] args) {
        DangerousMonster dragonZilla= new DragonZilla();
        mons(dragonZilla);
        dangerousM(dragonZilla);
        VeryBadVampire veryBadVampire = new VeryBadVampire();
        mons(veryBadVampire);
        dangerousM(veryBadVampire);
        let(veryBadVampire);
        /**
         * OutPut:
         * DragonZilla.menace()
         * DragonZilla.menace()
         * DragonZilla.destroy()
         * VeryBadVampire.menace()
         * VeryBadVampire.menace()
         * VeryBadVampire.destroy()
         * VeryBadVampire.kill()
         *
         * 总结：
         * 通过继承来扩展接口，添加新的方法声明
         */
    }
}
